package com.py.credit.dao;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.py.credit.entity.WarnRuleEntity;
import com.py.credit.entity.WarnSchemeEntity;
import com.py.framework.core.common.Page;

public interface OutInterfaceDao {
    /**
        * 校验是否生成过该主体的核查报告
     * @param tybm
     * @return
     */
	Integer checkIsExist(@Param(value="tybm")String tybm);
	/**
	 * 添加规则
	 * @param entity
	 */
	void addRule(WarnRuleEntity entity);
	/**
	 * 添加方案信息
	 * @param entity
	 */
	void addScheme(WarnSchemeEntity entity);
	/**
	 * 校验是否存在方案
	 * @param entity
	 */
    Integer	checkIsExistScheme(@Param(value="mainType")String mainType,@Param(value="status")String status);
	/**
	 * 更新方案信息
	 * @param entity
	 */
	void updateScheme(WarnSchemeEntity entity);
	/**
	 * 启用禁用方案
	 * @param status
	 * @param recordId
	 */
	void updateSchemeStatus(@Param(value="status")String status,@Param(value="recordId")String recordId);
	/**
	 * 分页查询方案信息
	 * @param page
	 * @return
	 */
	List<WarnSchemeEntity> selectSchemeForPage(
			@Param(value="name")String name,
			@Param(value="page")Page page,
			@Param(value="type")String type,
			@Param(value="deptName")String deptName,
			@Param(value="deptId")Long deptId,
			@Param(value="userId")Long userId);
	/**
	 * 通过启用方案查询绑定的规则
	 * @param kId
	 * @return
	 */
	List<WarnRuleEntity> selectRuleByScheme(@Param(value="schemeId")String schemeId);
	/**
	 * 绑定方案和规则
	 * @param list
	 */
	void addRuleAssociation(@Param(value="ruleId")String ruleId,@Param(value="schemeId")String schemeId);
     
	/**
	 * 解绑方案规则
	 * @param schemeId
	 */
	void updateAssociationDel(@Param(value="schemeId")String schemeId);
	
	/**
      * 查询企业信息
      * @param name
      * @param page
      * @return
      */
	List<Map> getCompanyInfoForPage(@Param(value="name")String name,@Param(value="page")Page page);
	/**
     * 查询人员信息
     * @param name
     * @param page
     * @return
     */
	List<Map> getPersonInfoForPage(@Param(value="name")String name,@Param(value="page")Page page);
	/**
	 * 通过方案的id删除绑定的规则
	 * @param tybm
	 */
	void deleteRuleByTybm(@Param(value="tybm")String tybm);
	/**
	 * 通过id修改规则
	 * @param entity
	 */
	void updateRuleById(WarnRuleEntity entity);
	
	void deleteRuleById(@Param(value="id") String id);

	List<Map<String,String>> getPeopleForPage(@Param(value= "tybm")String tybm,@Param(value="page")Page page,@Param(value="name")String name);

	List<Map<String,String>> getComForPage(@Param(value= "tybm")String tybm,@Param(value="page")Page page,@Param(value="name")String name);

	/**
    * 查询所有主体信息
    * @return
    */
	List<Map<String, Object>> selectComInfo();
	
	List<Map<String, Object>> selectPersonInfo();
	
	void addStatistics(@Param(value="list") List<Map<String,String>> list);
	
	void addRealateIndex(@Param(value="list") List<Map<String,String>> list);

	void deleteRealateIndex();
	
	List<Map<String,String>> getRelateIndex(@Param(value="list") List<String> list);
	
	List<Map<String,String>> getWarnInfoDataFrForPage(@Param(value="name")String name,@Param(value="page")Page page,@Param(value="tybm")String tybm,@Param(value="deptid")String deptid);
	
	List<Map<String,String>> getWarnInfoDataZrrForPage(@Param(value="name")String name,@Param(value="page")Page page,@Param(value="tybm")String tybm,@Param(value="deptid")String deptid);

	List<WarnRuleEntity> selectRuleForPage(@Param(value="name")String name,@Param(value="mainType")String mainType,@Param(value="page")Page page,@Param(value="deptId")Long deptId,@Param(value="userId")Long userId);

	List<Map<String,String>> selectRuleForBind(@Param(value="mainType")String mainType);
			
	void addModelTest(@Param(value="list") List<Map<String,Object>> list);
	
	void deleteModelTest();
	
	List<Map<String,Object>> getModelTestData(@Param(value="list") List<String> list);

	String SelectIndexSource(@Param(value="list")List<String> list);
		
	List<Map<String,Object>> getCreditReportData(@Param(value="tybm")String tybm);
	void delete(@Param(value="id")Integer id);
	void addFrList(@Param(value="tybms")List<String> tybms,@Param(value="recordId") String recordId);
	void addZrrList(@Param(value="tybms")List<String> tybms,@Param(value="recordId") String recordId);
	void addFqyList(@Param(value="tybms")List<String> tybms,@Param(value="recordId") String recordId);
	String getFileTybm(@Param(value="name")String name,@Param(value="tyshxydm")String tyshxydm,@Param(value="mainType") String mainType);
	void delQyxx(@Param(value="recordId")String recordId, @Param(value="mainType")String mainType);
	List<Map<String, Object>> selectUnComInfo();
	
	
	List<Map<String,String>> selectWarnDept();
	
	
	List<Map<String, String>> getWarnCompanyForPage(
			@Param(value="type")String type,
			@Param(value="recordId")String recordId, 
			@Param(value="mainType")String mainType,
			@Param(value="page")Page page);
	
	
	void deleterule(@Param(value="id")Integer id);
	

	
	int selectrepeat(@Param(value="tybm")String tybm, @Param(value="mainType")String mainType);
	
	
	
	List<Map<String, String>> getIsWarnCompanyForPage(@Param(value="type")String type,
			@Param(value="recordId")String recordId, 
			@Param(value="mainType")String mainType,
			@Param(value="page")Page page);
}
